<!--创建用户组 start-->
<div class="modal fade " id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"  style="margin-top: 80px">
    <div class="modal-dialog chery_dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="edit_add">

                </h4>
            </div>
            <form id="cgk_index_form" class="form_hori4" name="cgk_index_form" method="post" action="{:U('user_group_add')}" onSubmit="return make_sort()">
                <div class="modal-body" id="edit_add_show">
                    <input type=hidden id="id" name="id" value="">
                    <div class="right-panel-main">
                        <div class="down-x" style="margin-top: 0px;margin-left: 25%">
                            <span class="w-p1">用户组名称</span>
                            <input type=text name="title" class="form-control" style="width:192px;display: inline-block;" id="title" value="">
                        </div>
                        <div class="down-x" style="margin-top: 20px;margin-left: 25%">
                            <span class="w-p1">用户组描述</span>
                            <input type=text name="description" class="form-control" style="width:192px;display: inline-block;" value="">
                        </div>
                        <div class="down-x" style="margin-top: 20px;margin-left: 25%">
                            <span class="w-p1">是否为学生组</span>
                            <input type=radio name="stu_group" value="0" checked>否
                            &nbsp;&nbsp;
                            <input type=radio name="stu_group" value="1">是
                        </div>
                    </div>
                </div>
                <div class="modal-footer" style="text-align:center">
                    <input type=hidden id="module" name="module" value="Institution">
                    <button type="submit" class="action-button ajax-post" target-form="form_hori4" id="sub_button3">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--创建用户组  end-->
<script>

    function edit_group(f,t,d,s){
        if(f){
            $("#edit_add").text('修改用户组');

            $('input[name="title"]').val(t);
            $('input[name="id"]').val(f);
            $('input[name="description"]').val(d);
            if(s == 1){
                $('input[name="stu_group"]').eq(1).prop('checked',true);
                $('input[name="stu_group"]').eq(0).prop('checked',false);
            }else{
                $('input[name="stu_group"]').eq(0).prop('checked',true);
                $('input[name="stu_group"]').eq(1).prop('checked',false);
            }

        }else{
            $("#edit_add").text('创建用户组');
            $('input[name="title"]').val('');
            $('input[name="description"]').val('');
            $('input[name="stu_group"]').eq(0).prop('checked',true);
        }

    }
    function make_sort(f){
        var t=$.trim($("#title").val());
        if(!t){
            alert("请输入用户组名称");
            $("#title").focus();
            return false;
        }
    }
</script>